package com.msh.platform.elm.entity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Objects;

@Entity
@Table(name = "shop_cart_item", schema = "mscm_dev", catalog = "")
public class ShopCartItem {
    private int id;
    private Integer buyerId;
    private Integer sellerId;
    private Integer pubNoId;
    private Integer specId;
    private Integer dqTime;
    private BigDecimal price;
    private BigDecimal amount;
    private Integer stateTime;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "ID")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "buyer_id")
    public Integer getBuyerId() {
        return buyerId;
    }

    public void setBuyerId(Integer buyerId) {
        this.buyerId = buyerId;
    }
    
    @Basic
    @Column(name = "seller_id")
    public Integer getSellerId() {
        return sellerId;
    }

    public void setSellerId(Integer sellerId) {
        this.sellerId = sellerId;
    }

    @Basic
    @Column(name = "pub_no_id")
    public Integer getPubNoId() {
        return pubNoId;
    }

    public void setPubNoId(Integer pubNoId) {
        this.pubNoId = pubNoId;
    }

    @Basic
    @Column(name = "spec_id")
    public Integer getSpecId() {
        return specId;
    }

    public void setSpecId(Integer specId) {
        this.specId = specId;
    }

    @Basic
    @Column(name = "dq_time")
    public Integer getDqTime() {
        return dqTime;
    }

    public void setDqTime(Integer dqTime) {
        this.dqTime = dqTime;
    }

    @Basic
    @Column(name = "price")
    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    @Basic
    @Column(name = "amount")
    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "state_time")
    public Integer getStateTime() {
        return stateTime;
    }

    public void setStateTime(Integer stateTime) {
        this.stateTime = stateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ShopCartItem that = (ShopCartItem) o;
        return id == that.id &&
                Objects.equals(buyerId, that.buyerId) &&
                Objects.equals(pubNoId, that.pubNoId) &&
                Objects.equals(specId, that.specId) &&
                Objects.equals(dqTime, that.dqTime) &&
                Objects.equals(price, that.price) &&
                Objects.equals(amount, that.amount) &&
                Objects.equals(stateTime, that.stateTime);
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, buyerId, pubNoId, specId, dqTime, price, amount, stateTime);
    }
}
